const {mongodb,Schema} = require("./baseDB/db-movies")
const UserSchema = new Schema({
    username:String,
    pwd:String,
    /* Schema中定义模糊数组，可以添加，不能删除 */
    collects:[
        {
            labels:Array,
            _id:Schema.Types.ObjectId,
            pic:String,
            title:String,
            slogo:String,
            evaluate:String,
            rating:String,
            collected:Boolean
        }
    ],
    history:[
        {
            labels:Array,
            _id:Schema.Types.ObjectId,
            pic:String,
            title:String,
            slogo:String,
            evaluate:String,
            rating:String,
            collected:Boolean
        }
    ],
    artCollects:[
        {
            _id:Schema.Types.ObjectId,
            data:String,
            title:String,
            content:String,
            imgSrc: String,
            reading: String,
            detail: String,
            collectNum: Number,
            dateTime: String,
            headImgSrc: String,
            author: String,
            date: String,
            avatar: String,
            postId: String,
            music: {
                url: String,
                title: String,
                coverImg: String
            },
            collected: Boolean
        }
    ]
})
var UserModel =  mongodb.model("user",UserSchema,"user")
module.exports = UserModel